home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / gcc_260.zip / gcc_260 / INSTALL < prev    next >
Text File  |  1994-07-14  |  79KB  |  1,764 lines

  1. This file documents the installation of the GNU compiler.  Copyright
  2. (C) 1988, 1989, 1992 Free Software Foundation, Inc.  You may copy,
  3. distribute, and modify it freely as long as you preserve this copyright
  4. notice and permission notice.
  5.  
  6. Installing GNU CC
  7. *****************
  8.  
  9.    Here is the procedure for installing GNU CC on a Unix system.  See
  10. *Note VMS Install::, for VMS systems.  In this section we assume you
  11. compile in the same directory that contains the source files; see *Note
  12. Other Dir::, to find out how to compile in a separate directory on Unix
  13. systems.
  14.  
  15.    You cannot install GNU C by itself on MSDOS; it will not compile
  16. under any MSDOS compiler except itself.  You need to get the complete
  17. compilation package DJGPP, which includes binaries as well as sources,
  18. and includes all the necessary compilation tools and libraries.
  19.  
  20.   1. If you have built GNU CC previously in the same directory for a
  21.      different target machine, do `make distclean' to delete all files
  22.      that might be invalid.  One of the files this deletes is
  23.      `Makefile'; if `make distclean' complains that `Makefile' does not
  24.      exist, it probably means that the directory is already suitably
  25.      clean.
  26.  
  27.   2. On a System V release 4 system, make sure `/usr/bin' precedes
  28.      `/usr/ucb' in `PATH'.  The `cc' command in `/usr/ucb' uses
  29.      libraries which have bugs.
  30.  
  31.   3. Specify the host and target machine configurations.  You do this by
  32.      running the file `configure' with appropriate arguments.
  33.  
  34.      The `configure' script searches subdirectories of the source
  35.      directory for other compilers that are to be integrated into GNU
  36.      CC.  The GNU compiler for C++, called G++ is in a subdirectory
  37.      named `cp'.  `configure' inserts rules into `Makefile' to build
  38.      all of those compilers.
  39.  
  40.      If you are building a compiler to produce code for the machine it
  41.      runs on, specify the "configuration name" with the `--target'
  42.      option; the host will default to be the same as the target.  (If
  43.      you are building a cross-compiler, see *Note Cross-Compiler::.)
  44.  
  45.      Here is an example:
  46.  
  47.           ./configure --target=sparc-sun-sunos4.1
  48.  
  49.      If you run `configure' without specifying configuration arguments,
  50.      `configure' tries to guess the type of host you are on, and uses
  51.      that configuration type for both host and target.  So you don't
  52.      need to specify a configuration, for building a native compiler,
  53.      unless `configure' cannot figure out what your configuration is.
  54.  
  55.      A configuration name may be canonical or it may be more or less
  56.      abbreviated.
  57.  
  58.      A canonical configuration name has three parts, separated by
  59.      dashes.  It looks like this: `CPU-COMPANY-SYSTEM'.  (The three
  60.      parts may themselves contain dashes; `configure' can figure out
  61.      which dashes serve which purpose.)  For example,
  62.      `m68k-sun-sunos4.1' specifies a Sun 3.
  63.  
  64.      You can also replace parts of the configuration by nicknames or
  65.      aliases.  For example, `sun3' stands for `m68k-sun', so
  66.      `sun3-sunos4.1' is another way to specify a Sun 3.  You can also
  67.      use simply `sun3-sunos', since the version of SunOS is assumed by
  68.      default to be version 4.  `sun3-bsd' also works, since `configure'
  69.      knows that the only BSD variant on a Sun 3 is SunOS.
  70.  
  71.      You can specify a version number after any of the system types,
  72.      and some of the CPU types.  In most cases, the version is
  73.      irrelevant, and will be ignored.  So you might as well specify the
  74.      version if you know it.
  75.  
  76.      See *Note Configurations::, for a list of supported configuration
  77.      names and notes on many of the configurations.  You should check
  78.      the notes in that section before proceding any further with the
  79.      installation of GNU CC.
  80.  
  81.      There are four additional options you can specify independently to
  82.      describe variant hardware and software configurations.  These are
  83.      `--with-gnu-as', `--with-gnu-ld', `--with-stabs' and `--nfp'.
  84.  
  85.     `--with-gnu-as'
  86.           If you will use GNU CC with the GNU assembler (GAS), you
  87.           should declare this by using the `--with-gnu-as' option when
  88.           you run `configure'.
  89.  
  90.           Using this option does not install GAS.  It only modifies the
  91.           output of GNU CC to work with GAS.  Building and installing
  92.           GAS is up to you.
  93.  
  94.           Conversely, if you *do not* wish to use GAS and do not specify
  95.           `--with-gnu-as' when building GNU CC, it is up to you to make
  96.           sure that GAS is not installed.  GNU CC searches for a
  97.           program named `as' in various directories; if the program it
  98.           finds is GAS, then it runs GAS.  If you are not sure where
  99.           GNU CC finds the assembler it is using, try specifying `-v'
  100.           when you run it.
  101.  
  102.           The systems where it makes a difference whether you use GAS
  103.           are
  104.           `hppa1.0-ANY-ANY', `hppa1.1-ANY-ANY', `i386-ANY-sysv',
  105.           `i386-ANY-isc',
  106.           `i860-ANY-bsd', `m68k-bull-sysv', `m68k-hp-hpux',
  107.           `m68k-sony-bsd',
  108.           `m68k-altos-sysv', `m68000-hp-hpux', `m68000-att-sysv', and
  109.           `mips-ANY').  On any other system, `--with-gnu-as' has no
  110.           effect.
  111.  
  112.           On the systems listed above (except for the HP-PA and for ISC
  113.           on the 386), if you use GAS, you should also use the GNU
  114.           linker (and specify `--with-gnu-ld').
  115.  
  116.     `--with-gnu-ld'
  117.           Specify the option `--with-gnu-ld' if you plan to use the GNU
  118.           linker with GNU CC.
  119.  
  120.           This option does not cause the GNU linker to be installed; it
  121.           just modifies the behavior of GNU CC to work with the GNU
  122.           linker.  Specifically, it inhibits the installation of
  123.           `collect2', a program which otherwise serves as a front-end
  124.           for the system's linker on most configurations.
  125.  
  126.     `--with-stabs'
  127.           On MIPS based systems and on Alphas, you must specify whether
  128.           you want GNU CC to create the normal ECOFF debugging format,
  129.           or to use BSD-style stabs passed through the ECOFF symbol
  130.           table.  The normal ECOFF debug format cannot fully handle
  131.           languages other than C.  BSD stabs format can handle other
  132.           languages, but it only works with the GNU debugger GDB.
  133.  
  134.           Normally, GNU CC uses the ECOFF debugging format by default;
  135.           if you prefer BSD stabs, specify `--with-stabs' when you
  136.           configure GNU CC.
  137.  
  138.           No matter which default you choose when you configure GNU CC,
  139.           the user can use the `-gcoff' and `-gstabs+' options to
  140.           specify explicitly the debug format for a particular
  141.           compilation.
  142.  
  143.           `--with-stabs' is meaningful on the ISC system on the 386,
  144.           also, if `--with-gas' is used.  It selects use of stabs
  145.           debugging information embedded in COFF output.  This kind of
  146.           debugging information supports C++ well; ordinary COFF
  147.           debugging information does not.
  148.  
  149.     `--nfp'
  150.           On certain systems, you must specify whether the machine has
  151.           a floating point unit.  These systems include
  152.           `m68k-sun-sunosN' and `m68k-isi-bsd'.  On any other system,
  153.           `--nfp' currently has no effect, though perhaps there are
  154.           other systems where it could usefully make a difference.
  155.  
  156.      Here we spell out what files will be set up by `configure'.
  157.      Normally you need not be concerned with these files.
  158.  
  159.         * A symbolic link named `config.h' is made to the top-level
  160.           config file for the machine you plan to run the compiler on
  161.           (*note The Configuration File: (gcc.info)Config.).  This file
  162.           is responsible for defining information about the host
  163.           machine.  It includes `tm.h'.
  164.  
  165.           The top-level config file is located in the subdirectory
  166.           `config'.  Its name is always `xm-SOMETHING.h'; usually
  167.           `xm-MACHINE.h', but there are some exceptions.
  168.  
  169.           If your system does not support symbolic links, you might
  170.           want to set up `config.h' to contain a `#include' command
  171.           which refers to the appropriate file.
  172.  
  173.         * A symbolic link named `tconfig.h' is made to the top-level
  174.           config file for your target machine.  This is used for
  175.           compiling certain programs to run on that machine.
  176.  
  177.         * A symbolic link named `tm.h' is made to the
  178.           machine-description macro file for your target machine.  It
  179.           should be in the subdirectory `config' and its name is often
  180.           `MACHINE.h'.
  181.  
  182.         * A symbolic link named `md' will be made to the machine
  183.           description pattern file.  It should be in the `config'
  184.           subdirectory and its name should be `MACHINE.md'; but MACHINE
  185.           is often not the same as the name used in the `tm.h' file
  186.           because the `md' files are more general.
  187.  
  188.         * A symbolic link named `aux-output.c' will be made to the
  189.           output subroutine file for your machine.  It should be in the
  190.           `config' subdirectory and its name should be `MACHINE.c'.
  191.  
  192.         * The command file `configure' also constructs the file
  193.           `Makefile' by adding some text to the template file
  194.           `Makefile.in'.  The additional text comes from files in the
  195.           `config' directory, named `t-TARGET' and `x-HOST'.  If these
  196.           files do not exist, it means nothing needs to be added for a
  197.           given target or host.
  198.  
  199.   4. The standard directory for installing GNU CC is `/usr/local/lib'.
  200.      If you want to install its files somewhere else, specify
  201.      `--prefix=DIR' when you run `configure'.  Here DIR is a directory
  202.      name to use instead of `/usr/local' for all purposes with one
  203.      exception: the directory `/usr/local/include' is searched for
  204.      header files no matter where you install the compiler.  To override
  205.      this name, use thge `--local-prefix' option below.
  206.  
  207.   5. Specify `--local-prefix=DIR' if you want the compiler to search
  208.      directory `DIR/include' for header files *instead* of
  209.      `/usr/local/include'.  (This is for systems that have different
  210.      conventions for where to put site-specific things.)
  211.  
  212.      Unless you have a convention other than `/usr/local' for
  213.      site-specific files, it is a bad idea to specify `--local-prefix'.
  214.  
  215.   6. Make sure the Bison parser generator is installed.  (This is
  216.      unnecessary if the Bison output files `c-parse.c' and `cexp.c' are
  217.      more recent than `c-parse.y' and `cexp.y' and you do not plan to
  218.      change the `.y' files.)
  219.  
  220.      Bison versions older than Sept 8, 1988 will produce incorrect
  221.      output for `c-parse.c'.
  222.  
  223.   7. If you have chosen a configuration for GNU CC which requires other
  224.      GNU tools (such as GAS or the GNU linker) instead of the standard
  225.      system tools, install the required tools in the build directory
  226.      under the names `as', `ld' or whatever is appropriate.  This will
  227.      enable the compiler to find the proper tools for compilation of
  228.      the program `enquire'.
  229.  
  230.      Alternatively, you can do subsequent compilation using a value of
  231.      the `PATH' environment variable such that the necessary GNU tools
  232.      come before the standard system tools.
  233.  
  234.   8. Build the compiler.  Just type `make LANGUAGES=c' in the compiler
  235.      directory.
  236.  
  237.      `LANGUAGES=c' specifies that only the C compiler should be
  238.      compiled.  The makefile normally builds compilers for all the
  239.      supported languages; currently, C, C++ and Objective C.  However,
  240.      C is the only language that is sure to work when you build with
  241.      other non-GNU C compilers.  In addition, building anything but C
  242.      at this stage is a waste of time.
  243.  
  244.      In general, you can specify the languages to build by typing the
  245.      argument `LANGUAGES="LIST"', where LIST is one or more words from
  246.      the list `c', `c++', and `objective-c'.  If you have any
  247.      additional GNU compilers as subdirectories of the GNU CC source
  248.      directory, you may also specify their names in this list.
  249.  
  250.      Ignore any warnings you may see about "statement not reached" in
  251.      `insn-emit.c'; they are normal.  Also, warnings about "unknown
  252.      escape sequence" are normal in `genopinit.c' and perhaps some
  253.      other files.  Likewise, you should ignore warnings about "constant
  254.      is so large that it is unsigned" in `insn-emit.c' and
  255.      `insn-recog.c'.  Any other compilation errors may represent bugs in
  256.      the port to your machine or operating system, and should be
  257.      investigated and reported.
  258.  
  259.      Some commercial compilers fail to compile GNU CC because they have
  260.      bugs or limitations.  For example, the Microsoft compiler is said
  261.      to run out of macro space.  Some Ultrix compilers run out of
  262.      expression space; then you need to break up the statement where
  263.      the problem happens.
  264.  
  265.      If you are building with a previous GNU C compiler, do not use
  266.      `CC=gcc' on the make command or by editing the Makefile.  Instead,
  267.      use a full pathname to specify the compiler, such as
  268.      `CC=/usr/local/bin/gcc'.  This is because make might execute the
  269.      `gcc' in the current directory before all of the compiler
  270.      components have been built.
  271.  
  272.   9. If you are building a cross-compiler, stop here.  *Note
  273.      Cross-Compiler::.
  274.  
  275.  10. Move the first-stage object files and executables into a
  276.      subdirectory with this command:
  277.  
  278.           make stage1
  279.  
  280.      The files are moved into a subdirectory named `stage1'.  Once
  281.      installation is complete, you may wish to delete these files with
  282.      `rm -r stage1'.
  283.  
  284.  11. If you have chosen a configuration for GNU CC which requires other
  285.      GNU tools (such as GAS or the GNU linker) instead of the standard
  286.      system tools, install the required tools in the `stage1'
  287.      subdirectory under the names `as', `ld' or whatever is
  288.      appropriate.  This will enable the stage 1 compiler to find the
  289.      proper tools in the following stage.
  290.  
  291.      Alternatively, you can do subsequent compilation using a value of
  292.      the `PATH' environment variable such that the necessary GNU tools
  293.      come before the standard system tools.
  294.  
  295.  12. Recompile the compiler with itself, with this command:
  296.  
  297.           make CC="stage1/xgcc -Bstage1/" CFLAGS="-g -O"
  298.  
  299.      This is called making the stage 2 compiler.
  300.  
  301.      The command shown above builds compilers for all the supported
  302.      languages.  If you don't want them all, you can specify the
  303.      languages to build by typing the argument `LANGUAGES="LIST"'.  LIST
  304.      should contain one or more words from the list `c', `c++',
  305.      `objective-c', and `proto'.  Separate the words with spaces.
  306.      `proto' stands for the programs `protoize' and `unprotoize'; they
  307.      are not a separate language, but you use `LANGUAGES' to enable or
  308.      disable their installation.
  309.  
  310.      If you are going to build the stage 3 compiler, then you might
  311.      want to build only the C language in stage 2.
  312.  
  313.      Once you have built the stage 2 compiler, if you are short of disk
  314.      space, you can delete the subdirectory `stage1'.
  315.  
  316.      On a 68000 or 68020 system lacking floating point hardware, unless
  317.      you have selected a `tm.h' file that expects by default that there
  318.      is no such hardware, do this instead:
  319.  
  320.           make CC="stage1/xgcc -Bstage1/" CFLAGS="-g -O -msoft-float"
  321.  
  322.  13. If you wish to test the compiler by compiling it with itself one
  323.      more time, install any other necessary GNU tools (such as GAS or
  324.      the GNU linker) in the `stage2' subdirectory as you did in the
  325.      `stage1' subdirectory, then do this:
  326.  
  327.           make stage2
  328.           make CC="stage2/xgcc -Bstage2/" CFLAGS="-g -O"
  329.  
  330.      This is called making the stage 3 compiler.  Aside from the `-B'
  331.      option, the compiler options should be the same as when you made
  332.      the stage 2 compiler.  But the `LANGUAGES' option need not be the
  333.      same.  The command shown above builds compilers for all the
  334.      supported languages; if you don't want them all, you can specify
  335.      the languages to build by typing the argument `LANGUAGES="LIST"',
  336.      as described above.
  337.  
  338.      If you do not have to install any additional GNU tools, you may
  339.      use the command
  340.  
  341.           make bootstrap LANGUAGES=LANGUAGE-LIST BOOT_CFLAGS=OPTION-LIST
  342.  
  343.      instead of making `stage1', `stage2', and performing the two
  344.      compiler builds.
  345.  
  346.  14. Then compare the latest object files with the stage 2 object
  347.      files--they ought to be identical, aside from time stamps (if any).
  348.  
  349.      On some systems, meaningful comparison of object files is
  350.      impossible; they always appear "different."  This is currently
  351.      true on Solaris and probably on all systems that use ELF object
  352.      file format.  On some versions of Irix on SGI machines and OSF/1
  353.      on Alpha systems, you will not be able to compare the files
  354.      without specifying `-save-temps'; see the description of
  355.      individual systems above to see if you get comparison failures.
  356.      You may have similar problems on other systems.
  357.  
  358.      Use this command to compare the files:
  359.  
  360.           make compare
  361.  
  362.      This will mention any object files that differ between stage 2 and
  363.      stage 3.  Any difference, no matter how innocuous, indicates that
  364.      the stage 2 compiler has compiled GNU CC incorrectly, and is
  365.      therefore a potentially serious bug which you should investigate
  366.      and report.
  367.  
  368.      If your system does not put time stamps in the object files, then
  369.      this is a faster way to compare them (using the Bourne shell):
  370.  
  371.           for file in *.o; do
  372.           cmp $file stage2/$file
  373.           done
  374.  
  375.      If you have built the compiler with the `-mno-mips-tfile' option on
  376.      MIPS machines, you will not be able to compare the files.
  377.  
  378.  15. Build the Objective C library (if you have built the Objective C
  379.      compiler).  Here is the command to do this:
  380.  
  381.           make objc-runtime CC="stage2/xgcc -Bstage2/" CFLAGS="-g -O"
  382.  
  383.  16. Install the compiler driver, the compiler's passes and run-time
  384.      support with `make install'.  Use the same value for `CC',
  385.      `CFLAGS' and `LANGUAGES' that you used when compiling the files
  386.      that are being installed.  One reason this is necessary is that
  387.      some versions of Make have bugs and recompile files gratuitously
  388.      when you do this step.  If you use the same variable values, those
  389.      files will be recompiled properly.
  390.  
  391.      For example, if you have built the stage 2 compiler, you can use
  392.      the following command:
  393.  
  394.           make install CC="stage2/xgcc -Bstage2/" CFLAGS="-g -O" LANGUAGES="LIST"
  395.  
  396.      This copies the files `cc1', `cpp' and `libgcc.a' to files `cc1',
  397.      `cpp' and `libgcc.a' in the directory
  398.      `/usr/local/lib/gcc-lib/TARGET/VERSION', which is where the
  399.      compiler driver program looks for them.  Here TARGET is the target
  400.      machine type specified when you ran `configure', and VERSION is
  401.      the version number of GNU CC.  This naming scheme permits various
  402.      versions and/or cross-compilers to coexist.
  403.  
  404.      This also copies the driver program `xgcc' into
  405.      `/usr/local/bin/gcc', so that it appears in typical execution
  406.      search paths.
  407.  
  408.      On some systems, this command causes recompilation of some files.
  409.      This is usually due to bugs in `make'.  You should either ignore
  410.      this problem, or use GNU Make.
  411.  
  412.      *Warning: there is a bug in `alloca' in the Sun library.  To avoid
  413.      this bug, be sure to install the executables of GNU CC that were
  414.      compiled by GNU CC.  (That is, the executables from stage 2 or 3,
  415.      not stage 1.)  They use `alloca' as a built-in function and never
  416.      the one in the library.*
  417.  
  418.      (It is usually better to install GNU CC executables from stage 2
  419.      or 3, since they usually run faster than the ones compiled with
  420.      some other compiler.)
  421.  
  422.  17. Install the Objective C library (if you are installing the
  423.      Objective C compiler).  Here is the command to do this:
  424.  
  425.           make install-libobjc CC="stage2/xgcc -Bstage2/" CFLAGS="-g -O"
  426.  
  427.  18. If you're going to use C++, it's likely that you need to also
  428.      install the libg++ distribution.  It should be available from the
  429.      same place where you got the GNU C distribution.  Just as GNU C
  430.      does not distribute a C runtime library, it also does not include
  431.      a C++ run-time library.  All I/O functionality, special class
  432.      libraries, etc., are available in the libg++ distribution.
  433.  
  434. Configurations Supported by GNU CC
  435. ==================================
  436.  
  437.    Here are the possible CPU types:
  438.  
  439.      1750a, a29k, alpha, arm, cN, clipper, elxsi, h8300, hppa1.0,
  440.      hppa1.1, i370, i386, i486, i860, i960, m68000, m68k, m88k, mips,
  441.      ns32k, pyramid, romp, rs6000, sh, sparc, sparclite, sparc64, vax,
  442.      we32k.
  443.  
  444.    Here are the recognized company names.  As you can see, customary
  445. abbreviations are used rather than the longer official names.
  446.  
  447.      acorn, alliant, altos, apollo, att, bull, cbm, convergent, convex,
  448.      crds, dec, dg, dolphin, elxsi, encore, harris, hitachi, hp, ibm,
  449.      intergraph, isi, mips, motorola, ncr, next, ns, omron, plexus,
  450.      sequent, sgi, sony, sun, tti, unicom.
  451.  
  452.    The company name is meaningful only to disambiguate when the rest of
  453. the information supplied is insufficient.  You can omit it, writing
  454. just `CPU-SYSTEM', if it is not needed.  For example, `vax-ultrix4.2'
  455. is equivalent to `vax-dec-ultrix4.2'.
  456.  
  457.    Here is a list of system types:
  458.  
  459.      386bsd, aix, acis, amigados, aos, aout, bosx, bsd, clix, ctix,
  460.      cxux, dgux, dynix, ebmon, elf, esix, freebsd, hms, genix, gnu,
  461.      hiux, hpux, iris, irix, isc, linux, luna, lynxos, mach, minix,
  462.      msdos, mvs, netbsd, newsos, nindy, ns, osf, osfrose, riscix,
  463.      riscos, rtu, sco, solaris, sunos, sym, sysv, ultrix, unicos,
  464.      uniplus, unos, vms, vxworks, xenix.
  465.  
  466. You can omit the system type; then `configure' guesses the operating
  467. system from the CPU and company.
  468.  
  469.    You can add a version number to the system type; this may or may not
  470. make a difference.  For example, you can write `bsd4.3' or `bsd4.4' to
  471. distinguish versions of BSD.  In practice, the version number is most
  472. needed for `sysv3' and `sysv4', which are often treated differently.
  473.  
  474.    If you specify an impossible combination such as `i860-dg-vms', then
  475. you may get an error message from `configure', or it may ignore part of
  476. the information and do the best it can with the rest.  `configure'
  477. always prints the canonical name for the alternative that it used.  GNU
  478. CC does not support all possible alternatives.
  479.  
  480.    Often a particular model of machine has a name.  Many machine names
  481. are recognized as aliases for CPU/company combinations.  Thus, the
  482. machine name `sun3', mentioned above, is an alias for `m68k-sun'.
  483. Sometimes we accept a company name as a machine name, when the name is
  484. popularly used for a particular machine.  Here is a table of the known
  485. machine names:
  486.  
  487.      3300, 3b1, 3bN, 7300, altos3068, altos, apollo68, att-7300,
  488.      balance, convex-cN, crds, decstation-3100, decstation, delta,
  489.      encore, fx2800, gmicro, hp7NN, hp8NN, hp9k2NN, hp9k3NN, hp9k7NN,
  490.      hp9k8NN, iris4d, iris, isi68, m3230, magnum, merlin, miniframe,
  491.      mmax, news-3600, news800, news, next, pbd, pc532, pmax, powerpc,
  492.      ps2, risc-news, rtpc, sun2, sun386i, sun386, sun3, sun4, symmetry,
  493.      tower-32, tower.
  494.  
  495. Remember that a machine name specifies both the cpu type and the company
  496. name.  If you want to install your own homemade configuration files,
  497. you can use `local' as the company name to access them.  If you use
  498. configuration `CPU-local', the configuration name without the cpu prefix
  499. is used to form the configuration file names.
  500.  
  501.    Thus, if you specify `m68k-local', configuration uses files
  502. `local.md', `local.h', `local.c', `xm-local.h', `t-local', and
  503. `x-local', all in the directory `config/m68k'.
  504.  
  505.    Here is a list of configurations that have special treatment or
  506. special things you must know:
  507.  
  508. `1750a-*-*'
  509.      MIL-STD-1750A processors.  This port is preliminary.
  510.  
  511.      You should ignore a fatal error during the building of libgcc
  512.      (libgcc is not yet implemented for the 1750A.)
  513.  
  514.      The Tektronix MIL-STD-1750A Assembler requires the file
  515.      `m1750.inc', which is found in the directory `config/1750a'.
  516.  
  517.      GNU CC produced the same sections as the Fairchild F9450 C
  518.      Compiler, namely:
  519.  
  520.     `NREL'
  521.           The program code section.
  522.  
  523.     `SREL'
  524.           The read/write (RAM) data section.
  525.  
  526.     `KREL'
  527.           The read-only (ROM) constants section.
  528.  
  529.     `IREL'
  530.           Initialization section (code to copy KREL to SREL).
  531.  
  532.      The smallest addressable unit is 16 bits (BITS_PER_UNIT is 16).
  533.      This means that type `char' is represented with a 16-bit word per
  534.      character.  The 1750A's "Load/Store Upper/Lower Byte" instructions
  535.      are not used by GNU CC.
  536.  
  537.      There is a problem with long argument lists to functions.  The
  538.      compiler aborts if the sum of space needed by all arguments
  539.      exceeds 14 words.  This is because the arguments are passed in
  540.      registers (R0..R13) not on the stack, and there is a problem with
  541.      passing further arguments (i.e.  beyond those in R0..R13) via the
  542.      stack.
  543.  
  544.      If efficiency is less important than using long argument lists, you
  545.      can change the definition of the `FUNCTION_ARG' macro in
  546.      `config/1750/1750a.h' to always return zero.  If you do that, GNU
  547.      CC will pass all parameters on the stack.
  548.  
  549. `alpha-*-osf1'
  550.      Systems using processors that implement the DEC Alpha architecture
  551.      and are running the OSF/1 operating system, for example the DEC
  552.      Alpha AXP systems.  (VMS on the Alpha is not currently supported
  553.      by GNU CC.)
  554.  
  555.      GNU CC writes a `.verstamp' directive to the assembler output file
  556.      unless it is built as a cross-compiler.  It gets the version to
  557.      use from the system header file `/usr/include/stamp.h'.  If you
  558.      install a new version of OSF/1, you should rebuild GCC to pick up
  559.      the new version stamp.
  560.  
  561.      Note that since the Alpha is a 64-bit architecture,
  562.      cross-compilers from 32-bit machines will not generate code as
  563.      efficient as that generated when the compiler is running on a
  564.      64-bit machine because many optimizations that depend on being
  565.      able to represent a word on the target in an integral value on the
  566.      host cannot be performed.  Building cross-compilers on the Alpha
  567.      for 32-bit machines has only been tested in a few cases and may
  568.      not work properly.
  569.  
  570.      `make compare' may fail on old versions of OSF/1 unless you add
  571.      `-save-temps' to `CFLAGS'.  On these systems, the name of the
  572.      assembler input file is stored in the object file, and that makes
  573.      comparison fail if it differs between the `stage1' and `stage2'
  574.      compilations.  The option `-save-temps' forces a fixed name to be
  575.      used for the assembler input file, instead of a randomly chosen
  576.      name in `/tmp'.  Do not add `-save-temps' unless the comparisons
  577.      fail without that option.  If you add `-save-temps', you will have
  578.      to manually delete the `.i' and `.s' files after each series of
  579.      compilations.
  580.  
  581.      GNU CC now supports both the native (ECOFF) debugging format used
  582.      by DBX and GDB and an encapsulated STABS format for use only with
  583.      GDB.  See the discussion of the `--with-stabs' option of
  584.      `configure' above for more information on these formats and how to
  585.      select them.
  586.  
  587.      There is a bug in DEC's assembler that produces incorrect line
  588.      numbers for ECOFF format when the `.align' directive is used.  To
  589.      work around this problem, GNU CC will not emit such alignment
  590.      directives while writing ECOFF format debugging information even
  591.      if optimization is being performed.  Unfortunately, this has the
  592.      very undesirable side-effect that code addresses when `-O' is
  593.      specified are different depending on whether or not `-g' is also
  594.      specified.
  595.  
  596.      To avoid this behavior, specify `-gstabs+' and use GDB instead of
  597.      DBX.  DEC is now aware of this problem with the assembler and
  598.      hopes to provide a fix shortly.
  599.  
  600. `arm'
  601.      Advanced RISC Machines ARM-family processors.  These are often
  602.      used in embedded applications.  There are no standard Unix
  603.      configurations.  This configuration corresponds to the basic
  604.      instruction sequences and will produce a.out format object modules.
  605.  
  606.      You may need to make a variant of the file `arm.h' for your
  607.      particular configuration.
  608.  
  609. `arm-*-riscix'
  610.      The ARM2 or ARM3 processor running RISC iX, Acorn's port of BSD
  611.      Unix.  If you are running a version of RISC iX prior to 1.2 then
  612.      you must specify the version number during configuration.  Note
  613.      that the assembler shipped with RISC iX does not support stabs
  614.      debugging information; a new version of the assembler, with stabs
  615.      support included, is now available from Acorn.
  616.  
  617. `a29k'
  618.      AMD Am29k-family processors.  These are normally used in embedded
  619.      applications.  There are no standard Unix configurations.  This
  620.      configuration corresponds to AMD's standard calling sequence and
  621.      binary interface and is compatible with other 29k tools.
  622.  
  623.      You may need to make a variant of the file `a29k.h' for your
  624.      particular configuration.
  625.  
  626. `a29k-*-bsd'
  627.      AMD Am29050 used in a system running a variant of BSD Unix.
  628.  
  629. `decstation-*'
  630.      DECstations can support three different personalities: Ultrix, DEC
  631.      OSF/1, and OSF/rose.  To configure GCC for these platforms use the
  632.      following configurations:
  633.  
  634.     `decstation-ultrix'
  635.           Ultrix configuration.
  636.  
  637.     `decstation-osf1'
  638.           Dec's version of OSF/1.
  639.  
  640.     `decstation-osfrose'
  641.           Open Software Foundation reference port of OSF/1 which uses
  642.           the OSF/rose object file format instead of ECOFF.  Normally,
  643.           you would not select this configuration.
  644.  
  645.      The MIPS C compiler needs to be told to increase its table size
  646.      for switch statements with the `-Wf,-XNg1500' option in order to
  647.      compile `cp/parse.c'.  If you use the `-O2' optimization option,
  648.      you also need to use `-Olimit 3000'.  Both of these options are
  649.      automatically generated in the `Makefile' that the shell script
  650.      `configure' builds.  If you override the `CC' make variable and
  651.      use the MIPS compilers, you may need to add `-Wf,-XNg1500 -Olimit
  652.      3000'.
  653.  
  654. `elxsi-elxsi-bsd'
  655.      The Elxsi's C compiler has known limitations that prevent it from
  656.      compiling GNU C.  Please contact `mrs@cygnus.com' for more details.
  657.  
  658. `h8300-*-*'
  659.      The calling convention and structure layout has changed in release
  660.      2.6.  All code must be recompiled.  The calling convention now
  661.      passes the first three arguments in function calls in registers.
  662.      Structures are no longer a multiple of 2 bytes.
  663.  
  664. `hppa*-*-*'
  665.      There are two variants of this CPU, called 1.0 and 1.1, which have
  666.      different machine descriptions.  You must use the right one for
  667.      your machine.  All 7NN machines and 8N7 machines use 1.1, while
  668.      all other 8NN machines use 1.0.
  669.  
  670.      The easiest way to handle this problem is to use `configure hpNNN'
  671.      or `configure hpNNN-hpux', where NNN is the model number of the
  672.      machine.  Then `configure' will figure out if the machine is a 1.0
  673.      or 1.1.  Use `uname -a' to find out the model number of your
  674.      machine.
  675.  
  676.      `-g' does not work on HP-UX, since that system uses a peculiar
  677.      debugging format which GNU CC does not know about.  However, `-g'
  678.      will work if you also use GAS and GDB in conjunction with GCC.  We
  679.      highly recommend using GAS for all HP-PA configurations.
  680.  
  681.      You should be using GAS-2.3 (or later) along with GDB-4.12 (or
  682.      later).  These can be retrieved from all the traditional GNU ftp
  683.      archive sites.
  684.  
  685.      Build GAS and install the resulting binary as:
  686.  
  687.           /usr/local/lib/gcc-lib/CONFIGURATION/GCCVERSION/as
  688.  
  689.      where CONFIGURATION is the configuration name (perhaps
  690.      `hpNNN-hpux') and GCCVERSION is the GNU CC version number.  Do
  691.      this *before* starting the build process, otherwise you will get
  692.      errors from the HPUX assembler while building `libgcc2.a'.  The
  693.      command
  694.  
  695.           make install-dir
  696.  
  697.      will create the necessary directory hierarchy so you can install
  698.      GAS before building GCC.
  699.  
  700.      To enable debugging, configure GNU CC with the `--with-gnu-as'
  701.      option before building.
  702.  
  703.      It has been reported that GNU CC produces invalid assembly code for
  704.      1.1 machines running HP-UX 8.02 when using the HP assembler.
  705.      Typically the errors look like this:
  706.           as: bug.s @line#15 [err#1060]
  707.             Argument 0 or 2 in FARG upper
  708.                    - lookahead = ARGW1=FR,RTNVAL=GR
  709.           as: foo.s @line#28 [err#1060]
  710.             Argument 0 or 2 in FARG upper
  711.                    - lookahead = ARGW1=FR
  712.  
  713.      You can check the version of HP-UX you are running by executing
  714.      the command `uname -r'.   If you are indeed running HP-UX 8.02 on
  715.      a PA and using the HP assembler then configure GCC with
  716.      "hpNNN-hpux8.02".
  717.  
  718. `i370-*-*'
  719.      This port is very preliminary and has many known bugs.  We hope to
  720.      have a higher-quality port for this machine soon.
  721.  
  722. `i386-*-linux'
  723.      Bash-1.12 has a bug that causes configure to fail.  The symptom is
  724.      that the c++ subdirectory, cp, is not configured.  Bash-1.14 and
  725.      later work fine.
  726.  
  727. `i386-*-sco'
  728.      Compilation with RCC is recommended.  Also, it may be a good idea
  729.      to link with GNU malloc instead of the malloc that comes with the
  730.      system.
  731.  
  732. `i386-*-sco3.2.4'
  733.      Use this configuration for SCO release 3.2 version 4.
  734.  
  735. `i386-*-isc'
  736.      It may be good idea to link with GNU malloc instead of the malloc
  737.      that comes with the system.
  738.  
  739. `i386-*-esix'
  740.      It may be good idea to link with GNU malloc instead of the malloc
  741.      that comes with the system.
  742.  
  743. `i386-ibm-aix'
  744.      You need to use GAS version 2.1 or later, and and LD from GNU
  745.      binutils version 2.2 or later.
  746.  
  747. `i386-sequent'
  748.      Go to the Berkeley universe before compiling.  In addition, you
  749.      probably need to create a file named `string.h' containing just
  750.      one line: `#include <strings.h>'.
  751.  
  752. `i386-sun-sunos4'
  753.      You may find that you need another version of GNU CC to begin
  754.      bootstrapping with, since the current version when built with the
  755.      system's own compiler seems to get an infinite loop compiling part
  756.      of `libgcc2.c'.  GNU CC version 2 compiled with GNU CC (any
  757.      version) seems not to have this problem.
  758.  
  759.      See *Note Sun Install::, for information on installing GNU CC on
  760.      Sun systems.
  761.  
  762. `i860-intel-osf1'
  763.      This is the Paragon.  If you have version 1.0 of the operating
  764.      system, you need to take special steps to build GNU CC due to
  765.      peculiarities of the system.  Newer system versions have no
  766.      problem.  See the section `Installation Problems' in the GNU CC
  767.      Manual.
  768.  
  769. `m68000-hp-bsd'
  770.      HP 9000 series 200 running BSD.  Note that the C compiler that
  771.      comes with this system cannot compile GNU CC; contact
  772.      `law@cs.utah.edu' to get binaries of GNU CC for bootstrapping.
  773.  
  774. `m68k-altos'
  775.      Altos 3068.  You must use the GNU assembler, linker and debugger.
  776.      Also, you must fix a kernel bug.  Details in the file
  777.      `README.ALTOS'.
  778.  
  779. `m68k-att-sysv'
  780.      AT&T 3b1, a.k.a. 7300 PC.  Special procedures are needed to
  781.      compile GNU CC with this machine's standard C compiler, due to
  782.      bugs in that compiler.  You can bootstrap it more easily with
  783.      previous versions of GNU CC if you have them.
  784.  
  785.      Installing GNU CC on the 3b1 is difficult if you do not already
  786.      have GNU CC running, due to bugs in the installed C compiler.
  787.      However, the following procedure might work.  We are unable to
  788.      test it.
  789.  
  790.        1. Comment out the `#include "config.h"' line on line 37 of
  791.           `cccp.c' and do `make cpp'.  This makes a preliminary version
  792.           of GNU cpp.
  793.  
  794.        2. Save the old `/lib/cpp' and copy the preliminary GNU cpp to
  795.           that file name.
  796.  
  797.        3. Undo your change in `cccp.c', or reinstall the original
  798.           version, and do `make cpp' again.
  799.  
  800.        4. Copy this final version of GNU cpp into `/lib/cpp'.
  801.  
  802.        5. Replace every occurrence of `obstack_free' in the file
  803.           `tree.c' with `_obstack_free'.
  804.  
  805.        6. Run `make' to get the first-stage GNU CC.
  806.  
  807.        7. Reinstall the original version of `/lib/cpp'.
  808.  
  809.        8. Now you can compile GNU CC with itself and install it in the
  810.           normal fashion.
  811.  
  812. `m68k-bull-sysv'
  813.      Bull DPX/2 series 200 and 300 with BOS-2.00.45 up to BOS-2.01. GNU
  814.      CC works either with native assembler or GNU assembler. You can use
  815.      GNU assembler with native coff generation by providing
  816.      `--with-gnu-as' to the configure script or use GNU assembler with
  817.      dbx-in-coff encapsulation by providing `--with-gnu-as --stabs'.
  818.      For any problem with native assembler or for availability of the
  819.      DPX/2 port of GAS, contact `F.Pierresteguy@frcl.bull.fr'.
  820.  
  821. `m68k-crds-unox'
  822.      Use `configure unos' for building on Unos.
  823.  
  824.      The Unos assembler is named `casm' instead of `as'.  For some
  825.      strange reason linking `/bin/as' to `/bin/casm' changes the
  826.      behavior, and does not work.  So, when installing GNU CC, you
  827.      should install the following script as `as' in the subdirectory
  828.      where the passes of GCC are installed:
  829.  
  830.           #!/bin/sh
  831.           casm $*
  832.  
  833.      The default Unos library is named `libunos.a' instead of `libc.a'.
  834.      To allow GNU CC to function, either change all references to
  835.      `-lc' in `gcc.c' to `-lunos' or link `/lib/libc.a' to
  836.      `/lib/libunos.a'.
  837.  
  838.      When compiling GNU CC with the standard compiler, to overcome bugs
  839.      in the support of `alloca', do not use `-O' when making stage 2.
  840.      Then use the stage 2 compiler with `-O' to make the stage 3
  841.      compiler.  This compiler will have the same characteristics as the
  842.      usual stage 2 compiler on other systems.  Use it to make a stage 4
  843.      compiler and compare that with stage 3 to verify proper
  844.      compilation.
  845.  
  846.      (Perhaps simply defining `ALLOCA' in `x-crds' as described in the
  847.      comments there will make the above paragraph superfluous.  Please
  848.      inform us of whether this works.)
  849.  
  850.      Unos uses memory segmentation instead of demand paging, so you
  851.      will need a lot of memory.  5 Mb is barely enough if no other
  852.      tasks are running.  If linking `cc1' fails, try putting the object
  853.      files into a library and linking from that library.
  854.  
  855. `m68k-hp-hpux'
  856.      HP 9000 series 300 or 400 running HP-UX.  HP-UX version 8.0 has a
  857.      bug in the assembler that prevents compilation of GNU CC.  To fix
  858.      it, get patch PHCO_0800 from HP.
  859.  
  860.      In addition, if you wish to use gas `--with-gnu-as' you must use
  861.      gas version 2.1 or later, and you must use the GNU linker version
  862.      2.1 or later.  Earlier versions of gas relied upon a program which
  863.      converted the gas output into the native HP/UX format, but that
  864.      program has not been kept up to date.  gdb does not understand
  865.      that native HP/UX format, so you must use gas if you wish to use
  866.      gdb.
  867.  
  868. `m68k-sun'
  869.      Sun 3.  We do not provide a configuration file to use the Sun FPA
  870.      by default, because programs that establish signal handlers for
  871.      floating point traps inherently cannot work with the FPA.
  872.  
  873.      See *Note Sun Install::, for information on installing GNU CC on
  874.      Sun systems.
  875.  
  876. `m88k-*-svr3'
  877.      Motorola m88k running the AT&T/Unisoft/Motorola V.3 reference port.
  878.      These systems tend to use the Green Hills C, revision 1.8.5, as the
  879.      standard C compiler.  There are apparently bugs in this compiler
  880.      that result in object files differences between stage 2 and stage
  881.      3.  If this happens, make the stage 4 compiler and compare it to
  882.      the stage 3 compiler.  If the stage 3 and stage 4 object files are
  883.      identical, this suggests you encountered a problem with the
  884.      standard C compiler; the stage 3 and 4 compilers may be usable.
  885.  
  886.      It is best, however, to use an older version of GNU CC for
  887.      bootstrapping if you have one.
  888.  
  889. `m88k-*-dgux'
  890.      Motorola m88k running DG/UX.  To build native or cross compilers on
  891.      DG/UX, you must first change to the 88open BCS software development
  892.      environment.  This is done by issuing this command:
  893.  
  894.           eval `sde-target m88kbcs`
  895.  
  896. `m88k-tektronix-sysv3'
  897.      Tektronix XD88 running UTekV 3.2e.  Do not turn on optimization
  898.      while building stage1 if you bootstrap with the buggy Green Hills
  899.      compiler.  Also, The bundled LAI System V NFS is buggy so if you
  900.      build in an NFS mounted directory, start from a fresh reboot, or
  901.      avoid NFS all together.  Otherwise you may have trouble getting
  902.      clean comparisons between stages.
  903.  
  904. `mips-mips-bsd'
  905.      MIPS machines running the MIPS operating system in BSD mode.  It's
  906.      possible that some old versions of the system lack the functions
  907.      `memcpy', `memcmp', and `memset'.  If your system lacks these, you
  908.      must remove or undo the definition of `TARGET_MEM_FUNCTIONS' in
  909.      `mips-bsd.h'.
  910.  
  911.      The MIPS C compiler needs to be told to increase its table size
  912.      for switch statements with the `-Wf,-XNg1500' option in order to
  913.      compile `cp/parse.c'.  If you use the `-O2' optimization option,
  914.      you also need to use `-Olimit 3000'.  Both of these options are
  915.      automatically generated in the `Makefile' that the shell script
  916.      `configure' builds.  If you override the `CC' make variable and
  917.      use the MIPS compilers, you may need to add `-Wf,-XNg1500 -Olimit
  918.      3000'.
  919.  
  920. `mips-mips-riscos*'
  921.      The MIPS C compiler needs to be told to increase its table size
  922.      for switch statements with the `-Wf,-XNg1500' option in order to
  923.      compile `cp/parse.c'.  If you use the `-O2' optimization option,
  924.      you also need to use `-Olimit 3000'.  Both of these options are
  925.      automatically generated in the `Makefile' that the shell script
  926.      `configure' builds.  If you override the `CC' make variable and
  927.      use the MIPS compilers, you may need to add `-Wf,-XNg1500 -Olimit
  928.      3000'.
  929.  
  930.      MIPS computers running RISC-OS can support four different
  931.      personalities: default, BSD 4.3, System V.3, and System V.4 (older
  932.      versions of RISC-OS don't support V.4).  To configure GCC for
  933.      these platforms use the following configurations:
  934.  
  935.     `mips-mips-riscos`rev''
  936.           Default configuration for RISC-OS, revision `rev'.
  937.  
  938.     `mips-mips-riscos`rev'bsd'
  939.           BSD 4.3 configuration for RISC-OS, revision `rev'.
  940.  
  941.     `mips-mips-riscos`rev'sysv4'
  942.           System V.4 configuration for RISC-OS, revision `rev'.
  943.  
  944.     `mips-mips-riscos`rev'sysv'
  945.           System V.3 configuration for RISC-OS, revision `rev'.
  946.  
  947.      The revision `rev' mentioned above is the revision of RISC-OS to
  948.      use.  You must reconfigure GCC when going from a RISC-OS revision
  949.      4 to RISC-OS revision 5.  This has the effect of avoiding a linker
  950.      bug.
  951.  
  952. `mips-sgi-*'
  953.      Silicon Graphics MIPS machines running IRIX.  In order to compile
  954.      GCC on an SGI the "c.hdr.lib" option must be installed from the
  955.      CD-ROM supplied from Silicon Graphics.  This is found on the 2nd
  956.      CD in release 4.0.1.
  957.  
  958.      `make compare' may fail on version 5 of IRIX unless you add
  959.      `-save-temps' to `CFLAGS'.  On these systems, the name of the
  960.      assembler input file is stored in the object file, and that makes
  961.      comparison fail if it differs between the `stage1' and `stage2'
  962.      compilations.  The option `-save-temps' forces a fixed name to be
  963.      used for the assembler input file, instead of a randomly chosen
  964.      name in `/tmp'.  Do not add `-save-temps' unless the comparisons
  965.      fail without that option.  If you do you `-save-temps', you will
  966.      have to manually delete the `.i' and `.s' files after each series
  967.      of compilations.
  968.  
  969.      The MIPS C compiler needs to be told to increase its table size
  970.      for switch statements with the `-Wf,-XNg1500' option in order to
  971.      compile `cp/parse.c'.  If you use the `-O2' optimization option,
  972.      you also need to use `-Olimit 3000'.  Both of these options are
  973.      automatically generated in the `Makefile' that the shell script
  974.      `configure' builds.  If you override the `CC' make variable and
  975.      use the MIPS compilers, you may need to add `-Wf,-XNg1500 -Olimit
  976.      3000'.
  977.  
  978.      On Irix version 4.0.5F, and perhaps on some other versions as well,
  979.      there is an assembler bug that reorders instructions incorrectly.
  980.      To work around it, specify the target configuration
  981.      `mips-sgi-irix4loser'.  This configuration inhibits assembler
  982.      optimization.
  983.  
  984.      In a compiler configured with target `mips-sgi-irix4', you can turn
  985.      off assembler optimization by using the `-noasmopt' option.  This
  986.      compiler option passes the option `-O0' to the assembler, to
  987.      inhibit reordering.
  988.  
  989.      The `-noasmopt' option can be useful for testing whether a problem
  990.      is due to erroneous assembler reordering.  Even if a problem does
  991.      not go away with `-noasmopt', it may still be due to assembler
  992.      reordering--perhaps GNU CC itself was miscompiled as a result.
  993.  
  994.      See the file `README.IRIX5' for information on how to make
  995.      debugging work.
  996.  
  997. `mips-sony-sysv'
  998.      Sony MIPS NEWS.  This works in NEWSOS 5.0.1, but not in 5.0.2
  999.      (which uses ELF instead of COFF).  Support for 5.0.2 will probably
  1000.      be provided soon by volunteers.  In particular, the linker does
  1001.      not like the code generated by GCC when shared libraries are
  1002.      linked in.
  1003.  
  1004. `ns32k-encore'
  1005.      Encore ns32000 system.  Encore systems are supported only under
  1006.      BSD.
  1007.  
  1008. `ns32k-*-genix'
  1009.      National Semiconductor ns32000 system.  Genix has bugs in `alloca'
  1010.      and `malloc'; you must get the compiled versions of these from GNU
  1011.      Emacs.
  1012.  
  1013. `ns32k-sequent'
  1014.      Go to the Berkeley universe before compiling.  In addition, you
  1015.      probably need to create a file named `string.h' containing just
  1016.      one line: `#include <strings.h>'.
  1017.  
  1018. `ns32k-utek'
  1019.      UTEK ns32000 system ("merlin").  The C compiler that comes with
  1020.      this system cannot compile GNU CC; contact `tektronix!reed!mason'
  1021.      to get binaries of GNU CC for bootstrapping.
  1022.  
  1023. `romp-*-aos'
  1024. `romp-*-mach'
  1025.      The only operating systems supported for the IBM RT PC are AOS and
  1026.      MACH.  GNU CC does not support AIX running on the RT.  We
  1027.      recommend you compile GNU CC with an earlier version of itself; if
  1028.      you compile GNU CC with `hc', the Metaware compiler, it will work,
  1029.      but you will get mismatches between the stage 2 and stage 3
  1030.      compilers in various files.  These errors are minor differences in
  1031.      some floating-point constants and can be safely ignored; the stage
  1032.      3 compiler is correct.
  1033.  
  1034. `rs6000-*-aix'
  1035.      If you are running AIX version 3.2.5 and have XLC version 1.3.0.0,
  1036.      you must obtain XLC 1.3.0.2 by requesting PTF 421749 from IBM.  If
  1037.      you are using an older version of AIX you may have an old version
  1038.      of the IBM assembler, which cannot correctly handle debugging
  1039.      directives.  See the file `README.RS6000' for more details.
  1040.  
  1041.      The PowerPC and POWER2 architectures are now supported, but have
  1042.      not been very extensively tested due to lack of appropriate
  1043.      systems.  Only AIX is supported on the PowerPC.  GNU CC does not
  1044.      yet support the 64-bit PowerPC instructions.
  1045.  
  1046.      Objective C does not work on this architecture.
  1047.  
  1048.      AIX on the RS/6000 provides support (NLS) for environments outside
  1049.      of the United States.  Compilers and assemblers use NLS to support
  1050.      locale-specific representations of various objects including
  1051.      floating-point numbers ("." vs "," for separating decimal
  1052.      fractions).  There have been problems reported where the library
  1053.      linked with GNU CC does not produce the same floating-point
  1054.      formats that the assembler accepts.  If you have this problem, set
  1055.      the LANG environment variable to "C" or "En_US".
  1056.  
  1057. `vax-dec-ultrix'
  1058.      Don't try compiling with Vax C (`vcc').  It produces incorrect code
  1059.      in some cases (for example, when `alloca' is used).
  1060.  
  1061.      Meanwhile, compiling `cp/parse.c' with pcc does not work because of
  1062.      an internal table size limitation in that compiler.  To avoid this
  1063.      problem, compile just the GNU C compiler first, and use it to
  1064.      recompile building all the languages that you want to run.
  1065.  
  1066. `sparc-sun-*'
  1067.      See *Note Sun Install::, for information on installing GNU CC on
  1068.      Sun systems.
  1069.  
  1070. `vax-dec-vms'
  1071.      See *Note VMS Install::, for details on how to install GNU CC on
  1072.      VMS.
  1073.  
  1074. `we32k-*-*'
  1075.      These computers are also known as the 3b2, 3b5, 3b20 and other
  1076.      similar names.  (However, the 3b1 is actually a 68000; see *Note
  1077.      Configurations::.)
  1078.  
  1079.      Don't use `-g' when compiling with the system's compiler.  The
  1080.      system's linker seems to be unable to handle such a large program
  1081.      with debugging information.
  1082.  
  1083.      The system's compiler runs out of capacity when compiling `stmt.c'
  1084.      in GNU CC.  You can work around this by building `cpp' in GNU CC
  1085.      first, then use that instead of the system's preprocessor with the
  1086.      system's C compiler to compile `stmt.c'.  Here is how:
  1087.  
  1088.           mv /lib/cpp /lib/cpp.att
  1089.           cp cpp /lib/cpp.gnu
  1090.           echo '/lib/cpp.gnu -traditional ${1+"$@"}' > /lib/cpp
  1091.           chmod +x /lib/cpp
  1092.  
  1093.      The system's compiler produces bad code for some of the GNU CC
  1094.      optimization files.  So you must build the stage 2 compiler without
  1095.      optimization.  Then build a stage 3 compiler with optimization.
  1096.      That executable should work.  Here are the necessary commands:
  1097.  
  1098.           make LANGUAGES=c CC=stage1/xgcc CFLAGS="-Bstage1/ -g"
  1099.           make stage2
  1100.           make CC=stage2/xgcc CFLAGS="-Bstage2/ -g -O"
  1101.  
  1102.      You may need to raise the ULIMIT setting to build a C++ compiler,
  1103.      as the file `cc1plus' is larger than one megabyte.
  1104.  
  1105. Compilation in a Separate Directory
  1106. ===================================
  1107.  
  1108.    If you wish to build the object files and executables in a directory
  1109. other than the one containing the source files, here is what you must
  1110. do differently:
  1111.  
  1112.   1. Make sure you have a version of Make that supports the `VPATH'
  1113.      feature.  (GNU Make supports it, as do Make versions on most BSD
  1114.      systems.)
  1115.  
  1116.   2. If you have ever run `configure' in the source directory, you must
  1117.      undo the configuration.  Do this by running:
  1118.  
  1119.           make distclean
  1120.  
  1121.   3. Go to the directory in which you want to build the compiler before
  1122.      running `configure':
  1123.  
  1124.           mkdir gcc-sun3
  1125.           cd gcc-sun3
  1126.  
  1127.      On systems that do not support symbolic links, this directory must
  1128.      be on the same file system as the source code directory.
  1129.  
  1130.   4. Specify where to find `configure' when you run it:
  1131.  
  1132.           ../gcc/configure ...
  1133.  
  1134.      This also tells `configure' where to find the compiler sources;
  1135.      `configure' takes the directory from the file name that was used to
  1136.      invoke it.  But if you want to be sure, you can specify the source
  1137.      directory with the `--srcdir' option, like this:
  1138.  
  1139.           ../gcc/configure --srcdir=../gcc sun3
  1140.  
  1141.      The directory you specify with `--srcdir' need not be the same as
  1142.      the one that `configure' is found in.
  1143.  
  1144.    Now, you can run `make' in that directory.  You need not repeat the
  1145. configuration steps shown above, when ordinary source files change.  You
  1146. must, however, run `configure' again when the configuration files
  1147. change, if your system does not support symbolic links.
  1148.  
  1149. Building and Installing a Cross-Compiler
  1150. ========================================
  1151.  
  1152.    GNU CC can function as a cross-compiler for many machines, but not
  1153. all.
  1154.  
  1155.    * Cross-compilers for the Mips as target using the Mips assembler
  1156.      currently do not work, because the auxiliary programs
  1157.      `mips-tdump.c' and `mips-tfile.c' can't be compiled on anything
  1158.      but a Mips.  It does work to cross compile for a Mips if you use
  1159.      the GNU assembler and linker.
  1160.  
  1161.    * Cross-compilers between machines with different floating point
  1162.      formats have not all been made to work.  GNU CC now has a floating
  1163.      point emulator with which these can work, but each target machine
  1164.      description needs to be updated to take advantage of it.
  1165.  
  1166.    * Cross-compilation between machines of different word sizes has not
  1167.      really been addressed yet.
  1168.  
  1169.    Since GNU CC generates assembler code, you probably need a
  1170. cross-assembler that GNU CC can run, in order to produce object files.
  1171. If you want to link on other than the target machine, you need a
  1172. cross-linker as well.  You also need header files and libraries suitable
  1173. for the target machine that you can install on the host machine.
  1174.  
  1175. Steps of Cross-Compilation
  1176. --------------------------
  1177.  
  1178.    To compile and run a program using a cross-compiler involves several
  1179. steps:
  1180.  
  1181.    * Run the cross-compiler on the host machine to produce assembler
  1182.      files for the target machine.  This requires header files for the
  1183.      target machine.
  1184.  
  1185.    * Assemble the files produced by the cross-compiler.  You can do this
  1186.      either with an assembler on the target machine, or with a
  1187.      cross-assembler on the host machine.
  1188.  
  1189.    * Link those files to make an executable.  You can do this either
  1190.      with a linker on the target machine, or with a cross-linker on the
  1191.      host machine.  Whichever machine you use, you need libraries and
  1192.      certain startup files (typically `crt....o') for the target
  1193.      machine.
  1194.  
  1195.    It is most convenient to do all of these steps on the same host
  1196. machine, since then you can do it all with a single invocation of GNU
  1197. CC.  This requires a suitable cross-assembler and cross-linker.  For
  1198. some targets, the GNU assembler and linker are available.
  1199.  
  1200. Configuring a Cross-Compiler
  1201. ----------------------------
  1202.  
  1203.    To build GNU CC as a cross-compiler, you start out by running
  1204. `configure'.  You must specify two different configurations, the host
  1205. and the target.  Use the `--host=HOST' option for the host and
  1206. `--target=TARGET' to specify the target type.  For example, here is how
  1207. to configure for a cross-compiler that runs on a hypothetical Intel 386
  1208. system and produces code for an HP 68030 system running BSD:
  1209.  
  1210.      ./configure --target=m68k-hp-bsd4.3 --host=i386-bozotheclone-bsd4.3
  1211.  
  1212. Tools and Libraries for a Cross-Compiler
  1213. ----------------------------------------
  1214.  
  1215.    If you have a cross-assembler and cross-linker available, you should
  1216. install them now.  Put them in the directory `/usr/local/TARGET/bin'.
  1217. Here is a table of the tools you should put in this directory:
  1218.  
  1219. `as'
  1220.      This should be the cross-assembler.
  1221.  
  1222. `ld'
  1223.      This should be the cross-linker.
  1224.  
  1225. `ar'
  1226.      This should be the cross-archiver: a program which can manipulate
  1227.      archive files (linker libraries) in the target machine's format.
  1228.  
  1229. `ranlib'
  1230.      This should be a program to construct a symbol table in an archive
  1231.      file.
  1232.  
  1233.    The installation of GNU CC will find these programs in that
  1234. directory, and copy or link them to the proper place to for the
  1235. cross-compiler to find them when run later.
  1236.  
  1237.    The easiest way to provide these files is to build the Binutils
  1238. package and GAS.  Configure them with the same `--host' and `--target'
  1239. options that you use for configuring GNU CC, then build and install
  1240. them.  They install their executables automatically into the proper
  1241. directory.  Alas, they do not support all the targets that GNU CC
  1242. supports.
  1243.  
  1244.    If you want to install libraries to use with the cross-compiler,
  1245. such as a standard C library, put them in the directory
  1246. `/usr/local/TARGET/lib'; installation of GNU CC copies all all the
  1247. files in that subdirectory into the proper place for GNU CC to find
  1248. them and link with them.  Here's an example of copying some libraries
  1249. from a target machine:
  1250.  
  1251.      ftp TARGET-MACHINE
  1252.      lcd /usr/local/TARGET/lib
  1253.      cd /lib
  1254.      get libc.a
  1255.      cd /usr/lib
  1256.      get libg.a
  1257.      get libm.a
  1258.      quit
  1259.  
  1260. The precise set of libraries you'll need, and their locations on the
  1261. target machine, vary depending on its operating system.
  1262.  
  1263.    Many targets require "start files" such as `crt0.o' and `crtn.o'
  1264. which are linked into each executable; these too should be placed in
  1265. `/usr/local/TARGET/lib'.  There may be several alternatives for
  1266. `crt0.o', for use with profiling or other compilation options.  Check
  1267. your target's definition of `STARTFILE_SPEC' to find out what start
  1268. files it uses.  Here's an example of copying these files from a target
  1269. machine:
  1270.  
  1271.      ftp TARGET-MACHINE
  1272.      lcd /usr/local/TARGET/lib
  1273.      prompt
  1274.      cd /lib
  1275.      mget *crt*.o
  1276.      cd /usr/lib
  1277.      mget *crt*.o
  1278.      quit
  1279.  
  1280. `libgcc.a' and Cross-Compilers
  1281. ------------------------------
  1282.  
  1283.    Code compiled by GNU CC uses certain runtime support functions
  1284. implicitly.  Some of these functions can be compiled successfully with
  1285. GNU CC itself, but a few cannot be.  These problem functions are in the
  1286. source file `libgcc1.c'; the library made from them is called
  1287. `libgcc1.a'.
  1288.  
  1289.    When you build a native compiler, these functions are compiled with
  1290. some other compiler-the one that you use for bootstrapping GNU CC.
  1291. Presumably it knows how to open code these operations, or else knows how
  1292. to call the run-time emulation facilities that the machine comes with.
  1293. But this approach doesn't work for building a cross-compiler.  The
  1294. compiler that you use for building knows about the host system, not the
  1295. target system.
  1296.  
  1297.    So, when you build a cross-compiler you have to supply a suitable
  1298. library `libgcc1.a' that does the job it is expected to do.
  1299.  
  1300.    To compile `libgcc1.c' with the cross-compiler itself does not work.
  1301. The functions in this file are supposed to implement arithmetic
  1302. operations that GNU CC does not know how to open code, for your target
  1303. machine.  If these functions are compiled with GNU CC itself, they will
  1304. compile into infinite recursion.
  1305.  
  1306.    On any given target, most of these functions are not needed.  If GNU
  1307. CC can open code an arithmetic operation, it will not call these
  1308. functions to perform the operation.  It is possible that on your target
  1309. machine, none of these functions is needed.  If so, you can supply an
  1310. empty library as `libgcc1.a'.
  1311.  
  1312.    Many targets need library support only for multiplication and
  1313. division.  If you are linking with a library that contains functions for
  1314. multiplication and division, you can tell GNU CC to call them directly
  1315. by defining the macros `MULSI3_LIBCALL', and the like.  These macros
  1316. need to be defined in the target description macro file.  For some
  1317. targets, they are defined already.  This may be sufficient to avoid the
  1318. need for libgcc1.a; if so, you can supply an empty library.
  1319.  
  1320.    Some targets do not have floating point instructions; they need other
  1321. functions in `libgcc1.a', which do floating arithmetic.  Recent
  1322. versions of GNU CC have a file which emulates floating point.  With a
  1323. certain amount of work, you should be able to construct a floating
  1324. point emulator that can be used as `libgcc1.a'.  Perhaps future
  1325. versions will contain code to do this automatically and conveniently.
  1326. That depends on whether someone wants to implement it.
  1327.  
  1328.    If your target system has another C compiler, you can configure GNU
  1329. CC as a native compiler on that machine, build just `libgcc1.a' with
  1330. `make libgcc1.a' on that machine, and use the resulting file with the
  1331. cross-compiler.  To do this, execute the following on the target
  1332. machine:
  1333.  
  1334.      cd TARGET-BUILD-DIR
  1335.      ./configure --host=sparc --target=sun3
  1336.      make libgcc1.a
  1337.  
  1338. And then this on the host machine:
  1339.  
  1340.      ftp TARGET-MACHINE
  1341.      binary
  1342.      cd TARGET-BUILD-DIR
  1343.      get libgcc1.a
  1344.      quit
  1345.  
  1346.    Another way to provide the functions you need in `libgcc1.a' is to
  1347. define the appropriate `perform_...' macros for those functions.  If
  1348. these definitions do not use the C arithmetic operators that they are
  1349. meant to implement, you should be able to compile them with the
  1350. cross-compiler you are building.  (If these definitions already exist
  1351. for your target file, then you are all set.)
  1352.  
  1353.    To build `libgcc1.a' using the perform macros, use
  1354. `LIBGCC1=libgcc1.a OLDCC=./xgcc' when building the compiler.
  1355. Otherwise, you should place your replacement library under the name
  1356. `libgcc1.a' in the directory in which you will build the
  1357. cross-compiler, before you run `make'.
  1358.  
  1359. Cross-Compilers and Header Files
  1360. --------------------------------
  1361.  
  1362.    If you are cross-compiling a standalone program or a program for an
  1363. embedded system, then you may not need any header files except the few
  1364. that are part of GNU CC (and those of your program).  However, if you
  1365. intend to link your program with a standard C library such as `libc.a',
  1366. then you probably need to compile with the header files that go with
  1367. the library you use.
  1368.  
  1369.    The GNU C compiler does not come with these files, because (1) they
  1370. are system-specific, and (2) they belong in a C library, not in a
  1371. compiler.
  1372.  
  1373.    If the GNU C library supports your target machine, then you can get
  1374. the header files from there (assuming you actually use the GNU library
  1375. when you link your program).
  1376.  
  1377.    If your target machine comes with a C compiler, it probably comes
  1378. with suitable header files also.  If you make these files accessible
  1379. from the host machine, the cross-compiler can use them also.
  1380.  
  1381.    Otherwise, you're on your own in finding header files to use when
  1382. cross-compiling.
  1383.  
  1384.    When you have found suitable header files, put them in
  1385. `/usr/local/TARGET/include', before building the cross compiler.  Then
  1386. installation will run fixincludes properly and install the corrected
  1387. versions of the header files where the compiler will use them.
  1388.  
  1389.    Provide the header files before you build the cross-compiler, because
  1390. the build stage actually runs the cross-compiler to produce parts of
  1391. `libgcc.a'.  (These are the parts that *can* be compiled with GNU CC.)
  1392. Some of them need suitable header files.
  1393.  
  1394.    Here's an example showing how to copy the header files from a target
  1395. machine.  On the target machine, do this:
  1396.  
  1397.      (cd /usr/include; tar cf - .) > tarfile
  1398.  
  1399.    Then, on the host machine, do this:
  1400.  
  1401.      ftp TARGET-MACHINE
  1402.      lcd /usr/local/TARGET/include
  1403.      get tarfile
  1404.      quit
  1405.      tar xf tarfile
  1406.  
  1407. Actually Building the Cross-Compiler
  1408. ------------------------------------
  1409.  
  1410.    Now you can proceed just as for compiling a single-machine compiler
  1411. through the step of building stage 1.  If you have not provided some
  1412. sort of `libgcc1.a', then compilation will give up at the point where
  1413. it needs that file, printing a suitable error message.  If you do
  1414. provide `libgcc1.a', then building the compiler will automatically
  1415. compile and link a test program called `cross-test'; if you get errors
  1416. in the linking, it means that not all of the necessary routines in
  1417. `libgcc1.a' are available.
  1418.  
  1419.    If you are making a cross-compiler for an embedded system, and there
  1420. is no `stdio.h' header for it, then the compilation of `enquire' will
  1421. probably fail.  The job of `enquire' is to run on the target machine
  1422. and figure out by experiment the nature of its floating point
  1423. representation.  `enquire' records its findings in the header file
  1424. `float.h'.  If you can't produce this file by running `enquire' on the
  1425. target machine, then you will need to come up with a suitable `float.h'
  1426. in some other way (or else, avoid using it in your programs).
  1427.  
  1428.    Do not try to build stage 2 for a cross-compiler.  It doesn't work to
  1429. rebuild GNU CC as a cross-compiler using the cross-compiler, because
  1430. that would produce a program that runs on the target machine, not on the
  1431. host.  For example, if you compile a 386-to-68030 cross-compiler with
  1432. itself, the result will not be right either for the 386 (because it was
  1433. compiled into 68030 code) or for the 68030 (because it was configured
  1434. for a 386 as the host).  If you want to compile GNU CC into 68030 code,
  1435. whether you compile it on a 68030 or with a cross-compiler on a 386, you
  1436. must specify a 68030 as the host when you configure it.
  1437.  
  1438.    To install the cross-compiler, use `make install', as usual.
  1439.  
  1440. Installing GNU CC on the Sun
  1441. ============================
  1442.  
  1443.    On Solaris (version 2.1), do not use the linker or other tools in
  1444. `/usr/ucb' to build GNU CC.  Use `/usr/ccs/bin'.
  1445.  
  1446.    Make sure the environment variable `FLOAT_OPTION' is not set when
  1447. you compile `libgcc.a'.  If this option were set to `f68881' when
  1448. `libgcc.a' is compiled, the resulting code would demand to be linked
  1449. with a special startup file and would not link properly without special
  1450. pains.
  1451.  
  1452.    There is a bug in `alloca' in certain versions of the Sun library.
  1453. To avoid this bug, install the binaries of GNU CC that were compiled by
  1454. GNU CC.  They use `alloca' as a built-in function and never the one in
  1455. the library.
  1456.  
  1457.    Some versions of the Sun compiler crash when compiling GNU CC.  The
  1458. problem is a segmentation fault in cpp.  This problem seems to be due to
  1459. the bulk of data in the environment variables.  You may be able to avoid
  1460. it by using the following command to compile GNU CC with Sun CC:
  1461.  
  1462.      make CC="TERMCAP=x OBJS=x LIBFUNCS=x STAGESTUFF=x cc"
  1463.  
  1464. Installing GNU CC on VMS
  1465. ========================
  1466.  
  1467.    The VMS version of GNU CC is distributed in a backup saveset
  1468. containing both source code and precompiled binaries.
  1469.  
  1470.    To install the `gcc' command so you can use the compiler easily, in
  1471. the same manner as you use the VMS C compiler, you must install the VMS
  1472. CLD file for GNU CC as follows:
  1473.  
  1474.   1. Define the VMS logical names `GNU_CC' and `GNU_CC_INCLUDE' to
  1475.      point to the directories where the GNU CC executables
  1476.      (`gcc-cpp.exe', `gcc-cc1.exe', etc.) and the C include files are
  1477.      kept respectively.  This should be done with the commands:
  1478.  
  1479.           $ assign /system /translation=concealed -
  1480.             disk:[gcc.] gnu_cc
  1481.           $ assign /system /translation=concealed -
  1482.             disk:[gcc.include.] gnu_cc_include
  1483.  
  1484.      with the appropriate disk and directory names.  These commands can
  1485.      be placed in your system startup file so they will be executed
  1486.      whenever the machine is rebooted.  You may, if you choose, do this
  1487.      via the `GCC_INSTALL.COM' script in the `[GCC]' directory.
  1488.  
  1489.   2. Install the `GCC' command with the command line:
  1490.  
  1491.           $ set command /table=sys$common:[syslib]dcltables -
  1492.             /output=sys$common:[syslib]dcltables gnu_cc:[000000]gcc
  1493.           $ install replace sys$common:[syslib]dcltables
  1494.  
  1495.   3. To install the help file, do the following:
  1496.  
  1497.           $ library/help sys$library:helplib.hlb gcc.hlp
  1498.  
  1499.      Now you can invoke the compiler with a command like `gcc /verbose
  1500.      file.c', which is equivalent to the command `gcc -v -c file.c' in
  1501.      Unix.
  1502.  
  1503.    If you wish to use GNU C++ you must first install GNU CC, and then
  1504. perform the following steps:
  1505.  
  1506.   1. Define the VMS logical name `GNU_GXX_INCLUDE' to point to the
  1507.      directory where the preprocessor will search for the C++ header
  1508.      files.  This can be done with the command:
  1509.  
  1510.           $ assign /system /translation=concealed -
  1511.             disk:[gcc.gxx_include.] gnu_gxx_include
  1512.  
  1513.      with the appropriate disk and directory name.  If you are going to
  1514.      be using libg++, this is where the libg++ install procedure will
  1515.      install the libg++ header files.
  1516.  
  1517.   2. Obtain the file `gcc-cc1plus.exe', and place this in the same
  1518.      directory that `gcc-cc1.exe' is kept.
  1519.  
  1520.      The GNU C++ compiler can be invoked with a command like `gcc /plus
  1521.      /verbose file.cc', which is equivalent to the command `g++ -v -c
  1522.      file.cc' in Unix.
  1523.  
  1524.    We try to put corresponding binaries and sources on the VMS
  1525. distribution tape.  But sometimes the binaries will be from an older
  1526. version than the sources, because we don't always have time to update
  1527. them.  (Use the `/version' option to determine the version number of
  1528. the binaries and compare it with the source file `version.c' to tell
  1529. whether this is so.)  In this case, you should use the binaries you get
  1530. to recompile the sources.  If you must recompile, here is how:
  1531.  
  1532.   1. Execute the command procedure `vmsconfig.com' to set up the files
  1533.      `tm.h', `config.h', `aux-output.c', and `md.', and to create files
  1534.      `tconfig.h' and `hconfig.h'.  This procedure also creates several
  1535.      linker option files used by `make-cc1.com' and a data file used by
  1536.      `make-l2.com'.
  1537.  
  1538.           $ @vmsconfig.com
  1539.  
  1540.   2. Setup the logical names and command tables as defined above.  In
  1541.      addition, define the VMS logical name `GNU_BISON' to point at the
  1542.      to the directories where the Bison executable is kept.  This
  1543.      should be done with the command:
  1544.  
  1545.           $ assign /system /translation=concealed -
  1546.             disk:[bison.] gnu_bison
  1547.  
  1548.      You may, if you choose, use the `INSTALL_BISON.COM' script in the
  1549.      `[BISON]' directory.
  1550.  
  1551.   3. Install the `BISON' command with the command line:
  1552.  
  1553.           $ set command /table=sys$common:[syslib]dcltables -
  1554.             /output=sys$common:[syslib]dcltables -
  1555.             gnu_bison:[000000]bison
  1556.           $ install replace sys$common:[syslib]dcltables
  1557.  
  1558.   4. Type `@make-gcc' to recompile everything (alternatively, submit
  1559.      the file `make-gcc.com' to a batch queue).  If you wish to build
  1560.      the GNU C++ compiler as well as the GNU CC compiler, you must
  1561.      first edit `make-gcc.com' and follow the instructions that appear
  1562.      in the comments.
  1563.  
  1564.   5. In order to use GCC, you need a library of functions which GCC
  1565.      compiled code will call to perform certain tasks, and these
  1566.      functions are defined in the file `libgcc2.c'.  To compile this
  1567.      you should use the command procedure `make-l2.com', which will
  1568.      generate the library `libgcc2.olb'.  `libgcc2.olb' should be built
  1569.      using the compiler built from the same distribution that
  1570.      `libgcc2.c' came from, and `make-gcc.com' will automatically do
  1571.      all of this for you.
  1572.  
  1573.      To install the library, use the following commands:
  1574.  
  1575.           $ library gnu_cc:[000000]gcclib/delete=(new,eprintf)
  1576.           $ library gnu_cc:[000000]gcclib/delete=L_*
  1577.           $ library libgcc2/extract=*/output=libgcc2.obj
  1578.           $ library gnu_cc:[000000]gcclib libgcc2.obj
  1579.  
  1580.      The first command simply removes old modules that will be replaced
  1581.      with modules from `libgcc2' under different module names.  The
  1582.      modules `new' and `eprintf' may not actually be present in your
  1583.      `gcclib.olb'--if the VMS librarian complains about those modules
  1584.      not being present, simply ignore the message and continue on with
  1585.      the next command.  The second command removes the modules that
  1586.      came from the previous version of the library `libgcc2.c'.
  1587.  
  1588.      Whenever you update the compiler on your system, you should also
  1589.      update the library with the above procedure.
  1590.  
  1591.   6. You may wish to build GCC in such a way that no files are written
  1592.      to the directory where the source files reside.  An example would
  1593.      be the when the source files are on a read-only disk.  In these
  1594.      cases, execute the following DCL commands (substituting your
  1595.      actual path names):
  1596.  
  1597.           $ assign dua0:[gcc.build_dir.]/translation=concealed, -
  1598.                    dua1:[gcc.source_dir.]/translation=concealed  gcc_build
  1599.           $ set default gcc_build:[000000]
  1600.  
  1601.      where the directory `dua1:[gcc.source_dir]' contains the source
  1602.      code, and the directory `dua0:[gcc.build_dir]' is meant to contain
  1603.      all of the generated object files and executables.  Once you have
  1604.      done this, you can proceed building GCC as described above.  (Keep
  1605.      in mind that `gcc_build' is a rooted logical name, and thus the
  1606.      device names in each element of the search list must be an actual
  1607.      physical device name rather than another rooted logical name).
  1608.  
  1609.   7. *If you are building GNU CC with a previous version of GNU CC, you
  1610.      also should check to see that you have the newest version of the
  1611.      assembler*.  In particular, GNU CC version 2 treats global constant
  1612.      variables slightly differently from GNU CC version 1, and GAS
  1613.      version 1.38.1 does not have the patches required to work with GCC
  1614.      version 2.  If you use GAS 1.38.1, then `extern const' variables
  1615.      will not have the read-only bit set, and the linker will generate
  1616.      warning messages about mismatched psect attributes for these
  1617.      variables.  These warning messages are merely a nuisance, and can
  1618.      safely be ignored.
  1619.  
  1620.      If you are compiling with a version of GNU CC older than 1.33,
  1621.      specify `/DEFINE=("inline=")' as an option in all the
  1622.      compilations.  This requires editing all the `gcc' commands in
  1623.      `make-cc1.com'.  (The older versions had problems supporting
  1624.      `inline'.)  Once you have a working 1.33 or newer GNU CC, you can
  1625.      change this file back.
  1626.  
  1627.   8. If you want to build GNU CC with the VAX C compiler, you will need
  1628.      to make minor changes in `make-cccp.com' and `make-cc1.com' to
  1629.      choose alternate definitions of `CC', `CFLAGS', and `LIBS'.  See
  1630.      comments in those files.  However, you must also have a working
  1631.      version of the GNU assembler (GNU as, aka GAS) as it is used as
  1632.      the back-end for GNU CC to produce binary object modules and is
  1633.      not included in the GNU CC sources.  GAS is also needed to compile
  1634.      `libgcc2' in order to build `gcclib' (see above); `make-l2.com'
  1635.      expects to be able to find it operational in
  1636.      `gnu_cc:[000000]gnu-as.exe'.
  1637.  
  1638.      To use GNU CC on VMS, you need the VMS driver programs `gcc.exe',
  1639.      `gcc.com', and `gcc.cld'.  They are distributed with the VMS
  1640.      binaries (`gcc-vms') rather than the GNU CC sources.  GAS is also
  1641.      included in `gcc-vms', as is Bison.
  1642.  
  1643.      Once you have successfully built GNU CC with VAX C, you should use
  1644.      the resulting compiler to rebuild itself.  Before doing this, be
  1645.      sure to restore the `CC', `CFLAGS', and `LIBS' definitions in
  1646.      `make-cccp.com' and `make-cc1.com'.  The second generation
  1647.      compiler will be able to take advantage of many optimizations that
  1648.      must be suppressed when building with other compilers.
  1649.  
  1650.    Under previous versions of GNU CC, the generated code would
  1651. occasionally give strange results when linked with the sharable
  1652. `VAXCRTL' library.  Now this should work.
  1653.  
  1654.    Even with this version, however, GNU CC itself should not be linked
  1655. with the sharable `VAXCRTL'.  The version of `qsort' in `VAXCRTL' has a
  1656. bug (known to be present in VMS versions V4.6 through V5.5) which
  1657. causes the compiler to fail.
  1658.  
  1659.    The executables are generated by `make-cc1.com' and `make-cccp.com'
  1660. use the object library version of `VAXCRTL' in order to make use of the
  1661. `qsort' routine in `gcclib.olb'.  If you wish to link the compiler
  1662. executables with the shareable image version of `VAXCRTL', you should
  1663. edit the file `tm.h' (created by `vmsconfig.com') to define the macro
  1664. `QSORT_WORKAROUND'.
  1665.  
  1666.    `QSORT_WORKAROUND' is always defined when GNU CC is compiled with
  1667. VAX C, to avoid a problem in case `gcclib.olb' is not yet available.
  1668.  
  1669. `collect2'
  1670. ==========
  1671.  
  1672.    Many target systems do not have support in the assembler and linker
  1673. for "constructors"--initialization functions to be called before the
  1674. official "start" of `main'.  On such systems, GNU CC uses a utility
  1675. called `collect2' to arrange to call these functions at start time.
  1676.  
  1677.    The program `collect2' works by linking the program once and looking
  1678. through the linker output file for symbols with particular names
  1679. indicating they are constructor functions.  If it finds any, it creates
  1680. a new temporary `.c' file containing a table of them, compiles it, and
  1681. links the program a second time including that file.
  1682.  
  1683.    The actual calls to the constructors are carried out by a subroutine
  1684. called `__main', which is called (automatically) at the beginning of
  1685. the body of `main' (provided `main' was compiled with GNU CC).  Calling
  1686. `__main' is necessary, even when compiling C code, to allow linking C
  1687. and C++ object code together.  (If you use `-nostdlib', you get an
  1688. unresolved reference to `__main', since it's defined in the standard
  1689. GCC library.  Include `-lgcc' at the end of your compiler command line
  1690. to resolve this reference.)
  1691.  
  1692.    The program `collect2' is installed as `ld' in the directory where
  1693. the passes of the compiler are installed.  When `collect2' needs to
  1694. find the *real* `ld', it tries the following file names:
  1695.  
  1696.    * `real-ld' in the directories listed in the compiler's search
  1697.      directories.
  1698.  
  1699.    * `real-ld' in the directories listed in the environment variable
  1700.      `PATH'.
  1701.  
  1702.    * The file specified in the `REAL_LD_FILE_NAME' configuration macro,
  1703.      if specified.
  1704.  
  1705.    * `ld' in the compiler's search directories, except that `collect2'
  1706.      will not execute itself recursively.
  1707.  
  1708.    * `ld' in `PATH'.
  1709.  
  1710.    "The compiler's search directories" means all the directories where
  1711. `gcc' searches for passes of the compiler.  This includes directories
  1712. that you specify with `-B'.
  1713.  
  1714.    Cross-compilers search a little differently:
  1715.  
  1716.    * `real-ld' in the compiler's search directories.
  1717.  
  1718.    * `TARGET-real-ld' in `PATH'.
  1719.  
  1720.    * The file specified in the `REAL_LD_FILE_NAME' configuration macro,
  1721.      if specified.
  1722.  
  1723.    * `ld' in the compiler's search directories.
  1724.  
  1725.    * `TARGET-ld' in `PATH'.
  1726.  
  1727.    `collect2' explicitly avoids running `ld' using the file name under
  1728. which `collect2' itself was invoked.  In fact, it remembers up a list
  1729. of such names--in case one copy of `collect2' finds another copy (or
  1730. version) of `collect2' installed as `ld' in a second place in the
  1731. search path.
  1732.  
  1733.    `collect2' searches for the utilities `nm' and `strip' using the
  1734. same algorithm as above for `ld'.
  1735.  
  1736. Standard Header File Directories
  1737. ================================
  1738.  
  1739.    `GCC_INCLUDE_DIR' means the same thing for native and cross.  It is
  1740. where GNU CC stores its private include files, and also where GNU CC
  1741. stores the fixed include files.  A cross compiled GNU CC runs
  1742. `fixincludes' on the header files in `$(tooldir)/include'.  (If the
  1743. cross compilation header files need to be fixed, they must be installed
  1744. before GNU CC is built.  If the cross compilation header files are
  1745. already suitable for ANSI C and GNU CC, nothing special need be done).
  1746.  
  1747.    `GPLUS_INCLUDE_DIR' means the same thing for native and cross.  It
  1748. is where `g++' looks first for header files.  `libg++' installs only
  1749. target independent header files in that directory.
  1750.  
  1751.    `LOCAL_INCLUDE_DIR' is used only for a native compiler.  It is
  1752. normally `/usr/local/include'.  GNU CC searches this directory so that
  1753. users can install header files in `/usr/local/include'.
  1754.  
  1755.    `CROSS_INCLUDE_DIR' is used only for a cross compiler.  GNU CC
  1756. doesn't install anything there.
  1757.  
  1758.    `TOOL_INCLUDE_DIR' is used for both native and cross compilers.  It
  1759. is the place for other packages to install header files that GNU CC will
  1760. use.  For a cross-compiler, this is the equivalent of `/usr/include'.
  1761. When you build a cross-compiler, `fixincludes' processes any header
  1762. files in this directory.
  1763.  
  1764.